﻿using System.ComponentModel;

namespace Vtron.HipcConfigurationTools.Domain
{
    /// <summary>
    /// 网络参数
    /// </summary>
    public class NetworkInfo : INotifyPropertyChanged
    {
        #region Fields

        private bool isDHCP;
        private string ip;
        private string mask;
        private string gateway;
        private string mac;

        #endregion

        #region Properties

        /// <summary>
        /// 是否DHCP
        /// </summary>
        public bool IsDHCP
        {
            get { return isDHCP; }
            set
            {
                isDHCP = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged.Invoke(this, new PropertyChangedEventArgs("IsDHCP"));
                }
            }
        }

        /// <summary>
        /// IP地址
        /// </summary>
        public string Ip
        {
            get { return ip; }
            set
            {
                ip = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Ip"));
                }
            }
        }

        /// <summary>
        /// 子网掩码
        /// </summary>
        public string Mask
        {
            get { return mask; }
            set
            {
                mask = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Mask"));
                }
            }
        }

        /// <summary>
        /// 默认网关
        /// </summary>
        public string Gateway
        {
            get { return gateway; }
            set
            {
                gateway = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Gateway"));
                }
            }
        }

        /// <summary>
        /// MAC地址
        /// </summary>
        public string Mac
        {
            get { return mac; }
            set
            {
                mac = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Mac"));
                }
            }
        }

        #endregion

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
